package i18n

const (
	US = "en_US"
	CN = "zh_CN"
)

const (
	ER_MYSQL_CONNECTION_FAILED = iota
	ER_QUERY_NO_DATA_SOURCE
	INFO_QUERY
	INFO_TRANSFERRED_TO_NEXT_AGENT
	INFO_SUBMITTED
	ER_KEY_DECRYPTION_FAILED
	INFO_INITIALIZATION_SUCCESS_USERNAME_PASSWORD_RUN_COMMAND
	INFO_CHECKING_UPDATE
	INFO_ALREADY_INITIALIZED
	INFO_DATA_UPDATED
	INFO_FIX_DESTRUCTIVE_CHANGE
	INFO_FIX_SUCCESS
	INFO_YEARNING_MYSQL_AUDIT_PLATFORM
	INFO_CONFIG_FILE_PATH
	ER_DESTRUCTIVE_VERSION_UPGRADE_FIX
	INFO_RESET_SUPER_ADMIN_PASSWORD
	INFO_ADMIN_PASSWORD_RESET
	INFO_YEARNING_INSTALLATION_AND_DATA_INITIALIZATION
	INFO_YEARNING_STARTUP
	INFO_YEARNING_STARTUP_PORT
	INFO_PLATFORM_ADDRESS
	INFO_SPONSOR_KEY
	ER_LOGIN
	ER_REGISTER
	ER_REQ_BIND
	ER_REQ_FAKE
	ER_REQ_PASSWORD_FAKE
	INFO_ORDER_IS_CREATE
	INFO_ORDER_IS_DUP
	INFO_ORDER_IS_EDIT
	INFO_ORDER_IS_DELETE
	INFO_ORDER_IS_CLEAR
	INFO_ORDER_IS_AGREE
	INFO_ORDER_IS_UNDO
	INFO_ORDER_IS_REJECT
	INFO_ORDER_IS_ALL_END
	INFO_ORDER_IS_END
	INFO_ORDER_IS_ALL_CANCEL
	INFO_DATA_IS_DELETE
	INFO_DATA_IS_EDIT
	INFO_DATA_IS_UPDATED
	INFO_ORDER_DELAY_SUCCESS
	INFO_RULE_IS_ADD
	INFO_RULE_IS_UPDATED
	RULE_IS_DELETE
	INFO_LIBRARY_NAME_TABLE_NAME
	ER_ILLEGAL_GET_INFO
	UNDO_MESSAGE_ERROR
	UNDO_MESSAGE_SUCCESS
	COMMENT_IS_POST
	INFO_REGISTRATION_SUCCESS
	ER_USER_ALREADY_EXISTS
	INFO_OIDC_LOGIN_DISABLED
	CREATE_MESSAGE_SUCCESS
	CREATE_MESSAGE_ERROR
	EDIT_MESSAGE_SUCCESS
	EDIT_MESSAGE_ACTIVE
	CONN_TEST_SUCCESS
	DB_SAVE_SUCCESS
	ERR_DB_SAVE
	DB_EDIT_SUCCESS
	GROUP_DELETE_SUCCESS
	GROUP_CREATE_SUCCESS
	GROUP_EDIT_SUCCESS
	WEBHOOK_TEST
	MAIL_TEST
	ERR_LDAP_TEST
	SUCCESS_LDAP_TEST
	ER_MISSING_DATA_SOURCE
	ER_USER_REGUSTER
	USER_REGUSTER_SUCCESS
	USER_DELETE_SUCCESS
	USER_EDIT_SUCCESS
	USER_EDIT_PASSWORD_SUCCESS
	ADMIN_NOT_DELETE
	ADMIN_HAVE_DELETE_OTHER
	USER_PROLICY_EDIT_SUCCESS
	USER_CANNOT_DELETE
	BOARD_MESSAGE_SAVE
	ORDER_POST_SUCCESS
	CUSTOM_PASSWORD_SUCCESS
	ORDER_AGREE_MESSAGE
	ORDER_REJECT_MESSAGE
	ORDER_AGREE_STATE
	ORDER_REJECT_STATE
	ORDER_KILL_STATE
	ORDER_EXECUTE_STATE
	ORDER_DELAY_KILL_DETAIL
	ORDER_NOT_SEARCH
	ER_MISSING_SQL_STATEMENT
	ER_BLOB_FIELD_NOT_DISPLAYABLE
	INFO_SENSITIVE_FIELD
	INFO_QUERY_AUDIT_DISABLED
	ER_USER_NO_PERMISSION
	ER_DATABASE_CONNECTION_FAILED
	ERR_FLOW_ORDER_IS_NOT_COMPLETE
)

type lang struct {
	ll   map[int]string
	kind string
}

var DefaultLang = new(lang)

func MakeBuild(l string) {
	if l == CN {
		DefaultLang.ll = zh_CN
	} else {
		DefaultLang.ll = en_US
	}
}

func (l *lang) Load(key int) string {
	return l.ll[key]
}
